package com.example.android_three.mvp.activity

import android.content.Intent
import android.util.Log
import com.example.android_three.R
import com.example.lib_core.mvc.BaseActivity


class ScreenActivity : BaseActivity() {

    private lateinit var thread : MyThread

    override fun getLayoutId(): Int {

        return R.layout.activity_screen
    }

    override fun initView() {

        thread = MyThread()
    }

    override fun setOperation() {

        thread.start()
    }

    override fun setLinstener() {
    }

    inner class MyThread : Thread() {

        override fun run() {
            super.run()

            // Main2Activity的本类对象
            val mainThis = this@ScreenActivity

            // 休眠三秒
            sleep( 3000)

            // 跳转
            mainThis.runOnUiThread { ->

                Log.e("ghd", "run 方法的执行")

                var intent = Intent( mainThis, MainActivity::class.java )
                startActivity( intent )
                finish()
            }
        }
    }

}
